//
//  ZYHTTPResponseSerializer.h
//  ZYWebImage
//
//  Created by wzp on 2025/4/7.
//

#import <Foundation/Foundation.h>
#import "IZYURLResponseSerializer.h"

NS_ASSUME_NONNULL_BEGIN

@interface ZYHTTPResponseSerializer : NSObject <IZYURLResponseSerializer>

/// 成功状态码，非这个范围都是error，默认200--299成功
@property(nonatomic, copy, nullable) NSIndexSet *acceptableStatusCodes;

/// 可以接受的Content-Type
@property(nonatomic, copy, nullable) NSSet <NSString *> *acceptableContentTypes;

+ (instancetype)serializer;
- (instancetype)init;

- (BOOL)validateResponse:(nullable NSHTTPURLResponse *)response
                    data:(nullable NSData *)data
                   error:(NSError * _Nullable __autoreleasing *)error;
@end

NS_ASSUME_NONNULL_END
